import java.util.Scanner;
//输入一行字符串，打印用空格分隔开的字符串，然后再输出第二个单词的单词数。
public class J2411043 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
//        String str = "name=hyf age=24";
        String str1 = str;
        String[] strings = str1.split(" ");
        for (int i = 0; i < strings.length; i++) {
            System.out.println(strings[i]);
        }
        int count = 0;
        for (int i = 0; i < str.length(); i++) {
            count++;
        }
        int start = str.lastIndexOf(" ");
        int num = count - 1;
        System.out.println(num - start);
    }
}
